var ki=ki||{};ki.ToggleTabState=function(){function a(a){var e=a?"collapsed":"expanded",t=Xrm.Page.ui.tabs.get();for(var i in t){var s=t[i];s.getDisplayState()!=e&&1==s.getVisible()&&s.setDisplayState(e)}Xrm.Page.ui.process&&Xrm.Page.ui.process.setDisplayState(e)}function e(){isCollapse=!1;var a=Xrm.Page.ui.tabs.get();for(var e in a){var t=a[e];i&&t.addTabStateChange(ki.ToggleTabState.TabStateChange),"expanded"==t.getDisplayState()&&1==t.getVisible()&&(isCollapse=!0)}return i=!1,isCollapse}function t(){Xrm.Page.ui.refreshRibbon()}var i=!0;return{CollapseTabs:a,ToggleCollapseAndExpand:e,TabStateChange:t}}();